home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / Inspectors / InspectMe / Tank.m < prev    next >
Text File  |  1995-06-12  |  1KB  |  74 lines

  1. #import "Tank.h"
  2. #import "InspectMeDoc.h"
  3. #import "PSWraps.h"
  4. #import <dpsclient/wraps.h>
  5.  
  6. @implementation Tank
  7.  
  8. /* instance methods */
  9.  
  10. - initFrame:(NXRect *)frameRect
  11. {
  12.     [super initFrame:frameRect];
  13.     [self setOpaque:YES];
  14.     selected = NO;
  15.     holding = 25;
  16.     capacity = 100;
  17.     return self;
  18. }
  19.     
  20. - drawSelf:(NXRect *)rects :(int)rectCount
  21. {
  22.     PSsetgray(.666);
  23.     NXRectFill(&rects[0]);
  24.     PStank(bounds.size.width, bounds.size.height, selected);
  25.  
  26.     return self;
  27. }
  28.  
  29. - (BOOL)acceptsFirstMouse
  30. {
  31.     return YES;
  32. }
  33.  
  34. - mouseDown:(NXEvent *)e
  35. {
  36.     [[window delegate] setSelectedObject:self];
  37.     return self;
  38. }
  39.  
  40. - setSelected:(BOOL)yesOrNo
  41. {
  42.     selected = yesOrNo;
  43.     [self display];    
  44.         // note: if the outline is different if selected,
  45.         //  the above should be displayFromOpaqueAncestor:::
  46.     
  47.     return self;
  48. }
  49.  
  50.  
  51. // ---------------------------
  52. //      set/get attributes
  53. // ---------------------------
  54. - setHolding:(float)aFloat;
  55. {
  56.     holding = aFloat;
  57.     [self display];
  58.     return self;
  59. }
  60.  
  61. - (float)holding {return holding; }
  62.  
  63. - setCapacity:(float)aFloat;
  64. {
  65.     capacity = aFloat;
  66.     [self display];
  67.     return self;
  68. }
  69.  
  70. - (float)capacity {return capacity; }
  71.  
  72.  
  73. @end
  74.